﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;

namespace SHCP
{
    public static class InnerExtesion
    {
        static Regex RegNumber = new Regex(@"^[0-9]{6}$");
        static Regex RegMoney = new Regex(@"^[0-9]{2,7}$");
        public static bool IsCodeRight(this string code)
        {
            if (string.IsNullOrEmpty(code))
                return false;

            if (code.Length != 6)
                return false;

            return RegNumber.IsMatch(code);
        }


        public static bool IsMoney(this string s)
        {
            if (string.IsNullOrEmpty(s))
                return false;

            return RegMoney.IsMatch(s);
        }
    }
}
